package TangkGame01;

import java.util.Vector;

public class Hero extends Tank{
    Shot shot = null;
    Vector<Shot> shots = new Vector<>();
    public Hero(int x, int y) {
        super(x, y);
    }

    public void shotEnemyTank(){
        if (shots.size() == 5){
            return;
        }
        switch (direct){
            case 0: //向上
                shot = new Shot(x + 20, y, 0);
                break;
            case 1: //向右
                shot = new Shot(x + 60, y + 20, 1);
                break;
            case 2: //向下
                shot = new Shot(x + 20, y + 60, 2);
                break;
            case 3: //向左
                shot = new Shot(x, y + 20, 3);
                break;
        }
        shots.add(shot);
        new Thread(shot).start();
    }
}
